package com.liu.demo.service;

import com.liu.demo.pojo.StuScore;
import com.liu.demo.prository.StuScorePrository;
import com.liu.demo.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StuScoreService {
    @Autowired
    private StuScorePrository stuScorePrository;

    public List<StuScore> findAll(){
        return stuScorePrository.findAll();
    }

    public void insertScore(StuScore stuScore) {
        stuScorePrository.save(stuScore);
    }

    public void delScore(StuScore stuScore) {
        stuScorePrository.delete(stuScore);
    }

    public void upScore(StuScore stuScore) {
        stuScorePrository.save(stuScore);
    }

    public StuScore finByIdLike(Integer id) {
        return stuScorePrository.findByIdLike(id);
    }

    public List<StuScore> finBySnoLike(Integer sno) {
        return stuScorePrository.findBySnoLike(sno);
    }

    public List<StuScore> finBySnameLike(String sname) {
        return stuScorePrository.findBySnameLike(sname);
    }

    public List<StuScore> finByCnameLike(String cname) {
        return stuScorePrository.findByCnameLike(cname);
    }
}
